package com.gwnet.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gwnet.shop.domain.OrderDelivery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单发货Mapper接口
 * @author 张万鹏
 * @date 2024-07-21
 */
public interface OrderDeliveryMapper extends BaseMapper<OrderDelivery>
{
    /**
     * 查询订单发货
     *
     * @param id 订单发货主键
     * @return 订单发货
     */
    public OrderDelivery selectOrderDeliveryById(String id);

    /**
     * 查询订单发货列表
     *
     * @param orderDelivery 订单发货
     * @return 订单发货集合
     */
    public List<OrderDelivery> selectOrderDeliveryList(OrderDelivery orderDelivery);

    /**
     * 新增订单发货
     * @param orderDelivery 订单发货
     * @return 结果
     */
    public int insertOrderDelivery(OrderDelivery orderDelivery);

    /**
     * 修改订单发货
     *
     * @param orderDelivery 订单发货
     * @return 结果
     */
    public int updateOrderDelivery(OrderDelivery orderDelivery);

    /**
     * 删除订单发货
     *
     * @param id 订单发货主键
     * @return 结果
     */
    public int deleteOrderDeliveryById(String id);

    /**
     * 批量删除订单发货
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOrderDeliveryByIds(String[] ids);


    public int changeStatusByOrderId(@Param("orderId")String orderId, @Param("status")String status);

    /**
     * 查询没有正在执行的平台派单的骑手ID集合
     * @param riderIdList 给定的一批骑手ID
     * @return
     */
    List<Long> selectUnHavePlatformOrderRiderIdList(@Param("riderIdList") List<Long> riderIdList);

    /**
     * 定时查询数据库, 对已经配送完成用户没有点击确认的订单修改魏完成状态
     * @param deliveryStatus 配送状态
     * @param days 天数
     * @return
     */
    List<OrderDelivery> selectListAfterDelivery(@Param("deliveryStatus")String deliveryStatus,@Param("days")int days);
}
